import 'package:iidx_progress_tool/data/model/tag.dart';

class DifficultyProgress {
  bool normalClear;
  bool hardClear;
  bool exhardClear;

  List<Tag> tags;

  DifficultyProgress() :
      normalClear = false,
      hardClear = false,
      exhardClear = false,
      tags = [];

  DifficultyProgress.fromJson(Map<String, dynamic> json)
  : normalClear = json['normalClear'] as bool,
    hardClear = json['hardClear'] as bool,
    exhardClear = json['exhardClear'] as bool,
    tags = (json['tags'] as List<dynamic>).map((_) => Tag.fromJson(_)).toList();

  Map<String, dynamic> toJson() => {
    'normalClear': normalClear,
    'hardClear': hardClear,
    'exhardClear': exhardClear,
    'tags': tags.map((_) => _.toJson()).toList()
  };
}